<?php
class HttpException extends Exception
{
    private $data;
    public function __construct($message, $code, $data=array())
    {
        $org = ConfLib::get('http', 'output');
        if(empty($data)) {
            $this->data = $org;
            $this->data['tpl'] = $code; //todo json 怎么办
        } else {
            $this->data = array_merge($org, $data);
        }
        $this->data['http']['status_code'] = $code;
        parent::__construct($message, $code);
    }

    public function getData()
    {
        return $this->data;
    }
}
?>
